<?php
//Yeu cau su dung Mediafire la phai mo SSL trong PHP
//Mo file php.ini them vao dong nay neu chua co
//extension=php_openssl.dll
//Hoac neu co roi thi bo dau ";" di
class Admin_MediafireController extends Zend_Controller_Action {
	private $Session_Token='';
	private $email='thang_epc@yahoo.com.vn';
	private $password ='thangEPC123@';
	private $application_id='31774';
	private $signature='5681b1176c83263fd869e74e5504786e2066bbf9';
	public function init(){
		$this->Session_Token=Lib_Mediafire::getSessionToken(array (
				'email' => 'thang_epc@yahoo.com.vn',
				'password' => 'thangEPC123@',
				'application_id' => '31774',
				'signature' => '5681b1176c83263fd869e74e5504786e2066bbf9' 
		) );
		//$this->_helper->layout()->disableLayout();
		//$this->_helper->viewRenderer->setNoRender();
	}
	//Lay thong tin nguoi dung mediafire
	public function getinfouserAction() {
		$url = 'http://www.mediafire.com/api/user/get_info.php';
		print_r( Lib_Mediafire::getInfoByJson($url,array('session_token'=>$this->Session_Token)));
	}
	public function getmyfileAction(){
		print_r(Lib_Mediafire::getMyFile(array('session_token'=>$this->Session_Token)));
	}
	public function getrenewsessionAction(){
		//print_r('test');die();
		$json =Lib_Mediafire::getRenewSessionToken(array('session_token'=>$this->Session_Token));
		if($json['response']['result']=='Success'){
			$this->Session_Token=$json['response']['session_token'];
		}
		echo $this->Session_Token;
	}
	public function getlogintokenAction(){
		print_r(Lib_Mediafire::getMyFile(array('email'=>)));
	}
}